package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.tradeapplicationapprovefile.LindiTradeApplicationApproveFileVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationapprovefile.TradeApplicationApproveFileQueryVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiTradeApplicationApproveFileFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 林地指标交易平台_交易申请审批文件 Feign 客户端
 *
 * @author 11987
 */
@FeignClient(name = "minimalist-lindi"
        , contextId = "lindiTradeApplicationApproveFileFeignClient"
        , path = "/minimalist/lindi/tradeApplicationApproveFile"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiTradeApplicationApproveFileFeignClientFallbackFactory.class)
public interface LindiTradeApplicationApproveFileFeignClient{
    /**
     * 添加交易申请审批文件
     *
     * @param tradeApplicationApproveFileVO 交易申请审批文件信息
     * @return 成功或失败
     */
    @PostMapping("/addTradeApplicationApproveFile")
    @Operation(summary = "添加交易申请审批文件")
    R<?> addTradeApplicationApproveFile(
            @RequestBody @Validated(Add.class)
            LindiTradeApplicationApproveFileVO tradeApplicationApproveFileVO);

    /**
     * 删除交易申请审批文件 -> 根据审批文件ID删除
     *
     * @param approveFileId 审批文件ID
     * @return 成功或失败
     */
    @DeleteMapping("/deleteTradeApplicationApproveFileByApproveFileId")
    @Operation(summary = "删除交易申请审批文件 -> 根据审批文件ID删除")
    R<?> deleteTradeApplicationApproveFileByApproveFileId(
            @RequestParam("approveFileId")
            @NotNull(message = "审批文件ID不能为空")
            @Parameter(name = "approveFileId", required = true, description = "审批文件ID")
            Long approveFileId);

    /**
     * 修改交易申请审批文件
     *
     * @param tradeApplicationApproveFileVO 交易申请审批文件信息
     * @return 成功或失败
     */
    @PutMapping("/updateTradeApplicationApproveFileByApproveFileId")
    @Operation(summary = "修改交易申请审批文件")
    R<?> updateTradeApplicationApproveFileByApproveFileId(
            @RequestBody @Validated(Update.class)
            LindiTradeApplicationApproveFileVO tradeApplicationApproveFileVO);

    /**
     * 查询交易申请审批文件列表(分页)
     *
     * @param queryVO 查询条件
     * @return 交易申请审批文件列表
     */
    @GetMapping("/getPageTradeApplicationApproveFileList")
    @Operation(summary = "查询交易申请审批文件列表(分页)")
    R<PageResp<LindiTradeApplicationApproveFileVO>> getPageTradeApplicationApproveFileList(
            @RequestBody TradeApplicationApproveFileQueryVO queryVO);

    /**
     * 根据审批文件ID查询交易申请审批文件
     *
     * @param approveFileId 审批文件ID
     * @return 交易申请审批文件
     */
    @GetMapping("/getTradeApplicationApproveFileByApproveFileId/{approveFileId}")
    @Operation(summary = "根据审批文件ID查询交易申请审批文件")
    R<LindiTradeApplicationApproveFileVO> getTradeApplicationApproveFileByApproveFileId(
            @PathVariable(value = "approveFileId")
            @NotNull(message = "审批文件ID不能为空")
            @Parameter(name = "approveFileId", description = "审批文件ID", required = true)
            Long approveFileId);
}